#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iso646.h>
#include <stdbool.h>
#include <memory.h>
#include <math.h>


#ifndef GENERAL_H
#define GENERAL_H 1

char error_message[200];
char info_message[200];
char warn_message[200];


char * red_s = "\e[0;31m";
char * green_s = "\e[0;32m";
char * yellow_s = "\e[0;33m";
char * blue_s = "\e[0;34m";
char * origin_s = "\e[0m";

char * red(char * str){
    int length = strlen(str);
    // +1 for \0
    char * reded_str = (char *) malloc(sizeof(char) * (strlen(red_s) + strlen(origin_s) + length));
    strcpy(reded_str, red_s);
    reded_str = strcat(reded_str, str);
    reded_str = strcat(reded_str, origin_s);
    return reded_str;
}

char * green(char * str){
    int length = strlen(str);
    // +1 for \0
    char * greened_str = (char *) malloc(sizeof(char) * (strlen(green_s) + strlen(origin_s) + length));
    strcpy(greened_str, green_s);
    greened_str = strcat(greened_str, str);
    greened_str = strcat(greened_str, origin_s);
    return greened_str;
}

char * yellow(char * str){
    int length = strlen(str);
    // +1 for \0
    char * yellowed_str = (char *) malloc(sizeof(char) * (strlen(yellow_s) + strlen(origin_s) + length));
    strcpy(yellowed_str, yellow_s);
    yellowed_str = strcat(yellowed_str, str);
    yellowed_str = strcat(yellowed_str, origin_s);
    return yellowed_str;
}

char * blue(char * str){
    int length = strlen(str);
    // +1 for \0
    char * blued_str = (char *) malloc(sizeof(char) * (strlen(blue_s) + strlen(origin_s) + length));
    strcpy(blued_str, blue_s);
    blued_str = strcat(blued_str, str);
    blued_str = strcat(blued_str, origin_s);
    return blued_str;
}


#endif